package com.caow.baselibrary.utils

import android.os.Bundle
import com.alibaba.android.arouter.launcher.ARouter
import com.caow.baselibrary.event.LogoutEvent
import org.greenrobot.eventbus.EventBus

/**
 * @Author caow
 * 2023/3/10
 */
object NavigatorUtils {
    fun push(route: String, bundle: Bundle? = null) {
        val router = ARouter.getInstance().build(route)
        bundle?.let { router.with(it) }
        router.navigation()
//            .withString("key", "我是携带的参数")
    }

    fun logout(route: String) {
        push(route)
        EventBus.getDefault().post(LogoutEvent())
    }
}